<DOCTYPE html>
<html>
<head>
    <title>团购</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <?php foreach ($this->config->item('style_css_paths') as $css): ?>
      <link rel="stylesheet" href=<?php echo $css ?> />
    <?php endforeach ?>
    <?php foreach ($this->config->item('style_js_paths') as $js): ?>
      <script type="text/javascript" src=<?php echo $js?> ></script>
    <?php endforeach ?>
    <!-- bxSlider Javascript file -->
    <script src=<?php echo base_url("/scripts/jquery.bxslider.min.js") ?>></script>
    <!-- bxSlider CSS file -->
    <link href=<?php echo base_url("/scripts/jquery.bxslider.css") ?>  rel="stylesheet" />
    <script type="text/javascript" src=<?php echo base_url("/scripts/logic/uihelper.js") ;?>></script>
</head>
 
<body>
    <!-- Below parts are used for group shop -->
    <div data-role="page" id="groupshop"> 
        <div data-role="header" data-tap-toggle="false" data-theme="a"  data-position="fixed">
            <a href="#" class="ui-btn" data-rel="back">返回</a>
            <h1><?php echo $group_detail['group_name'] ;?></h1>
            <?php 
                $isHistory = $this->input->get('isHistory', True);
                if ($isHistory != "y"){ 
            ?>
            <a  href=<?php echo site_url("grouppurchase/createGroupBill?group_id=") . $group_detail['group_id']; ?> class="<?php if($isAva == False) echo "ui-state-disabled" ;?> ui-btn-right ui-btn ui-btn-b ui-btn-inline ui-mini ui-corner-all ui-btn-icon-right ui-icon-check">下单</a>
            <?php } ?>
        </div>   
        <div role="main" class="ui-content">
            <!-- sliding pictures -->
            <ul class="bxslider">

              <?php foreach($group_pics as $pic):?>

              <li><img src=<?php echo base_url() . $pic['pic_url']?> /></li>

            <?php endforeach; ?>

            </ul>

            <?php if($isAva == False) {;?>
                <div class="ui-corner-all custom-corners">
                  <div class="ui-bar ui-bar-a">
                    <h3 style="color: rgb(255, 0, 82);">此团购无法继续购买</h3>
                  </div>
                  <div class="ui-body ui-body-a">
                    <?php if($isOutOfDate){ ?>
                        <p>o(╯□╰)o 团购已结束</p>
                    <?php }?>
                    <?php if($isSoldOut){ ?>
                        <p>o(╯□╰)o 团购已售完</p>
                    <?php }?>
                    <?php if($group_detail["group_state"] == 4){ ?>
                        <p>o(╯□╰)o 该团购已下架(不影响已购团购)</p>
                    <?php }?>
                    <?php if($group_detail["group_state"] == 5){ ?>
                        <p>o(╯□╰)o 该团购有最新版本，请至最新版本购买(不影响已购团购)</p>
                    <?php }?>
                  </div>
                </div> 
                <br/>
            <?php }?>

            <div class="ui-corner-all custom-corners">
              <div class="ui-bar ui-bar-a">
                <h3>简要介绍</h3>
              </div>
              <div class="ui-body ui-body-a">
                <p><?php echo $group_detail['brief_des'] ;?></p>
              </div>
            </div> 


            <div data-role="collapsible" data-collapsed-icon="carat-d" data-collapsed="false" data-expanded-icon="carat-u">
                <h4><?php echo $group_detail['group_name'] ;?></h4>
                <ul data-role="listview" data-inset="false">
                    <li>单价：<?php echo $group_detail['group_price'] ;?>元</li>
                    <li>使用截止：<?php echo $group_detail['use_deadline'] ;?></li>
                    <li>购买截止：<?php echo $group_detail['buy_deadline'] ;?></li>
                    <?php if ($isHistory != "y"){ ?>
                    <li>购买人数：<?php echo $group_detail['user_num'] . " / " . $group_detail['user_capacity'] ;?></li>
                    <li>购买数量：<?php echo ($group_detail['buy_num'] . " / " . $group_detail['group_capacity'] );?></li>
                    <?php } ?>
                </ul>
            </div>

            <div data-role="collapsible" data-collapsed-icon="action" data-collapsed="true" data-expanded-icon="action">
                <h4>更多说明</h4>
                <ul data-role="listview" data-inset="false">
                    <li>店铺名称：<?php echo $group_detail['store_name'] ;?></li>
                    <li>联系方式：<?php echo $group_detail['store_phone'] ;?></li>
                    <li>店铺地址：<?php echo $group_detail['store_addr'] ;?></li>
                    <li>使用说明：<?php echo $group_detail['use_guide'] ;?></li>
                    <li>详细说明：</li>
                </ul>
                <p></p>
                
                <?php echo $group_detail['detail_des'] ;?>

           </div>
            <?php if ($isHistory != "y"){ ?>
            <a href=<?php echo site_url("grouppurchase/createGroupBill?group_id=") . $group_detail['group_id']; ?> class="ui-btn ui-corner-all ui-btn-b <?php if($isAva == False) echo "ui-state-disabled" ;?>">马上订购</a>
            <?php } ?>
        </div>   
        <div data-role="footer" data-tap-toggle="false" data-position="fixed">
            <div data-role="navbar">
              <ul>
                <li><a href=<?php echo site_url('welcome');?> data-icon="home">主页</a></li>
                <li><a href=<?php echo site_url("welcome/shop") ;?> class="ui-btn-active ui-state-persist" data-icon="shop">店铺</a></li>
                <li><a href=<?php echo site_url('welcome/history') ;?>   data-icon="check">历史订单</a></li>
                <li><a href=<?php echo site_url('welcome/info');?> data-icon="info">个人信息</a></li>
              </ul>
            </div>
        </div>
    </div>

</body> 
</html>

